package com.galaxis.wms.query

import com.galaxis.wms.entity.BasRoleResourceRel
import com.querydsl.core.types.Path
import com.querydsl.core.types.PathMetadata
import com.querydsl.core.types.dsl.DateTimePath
import com.querydsl.core.types.dsl.NumberPath
import com.querydsl.core.types.dsl.StringPath
import com.querydsl.sql.ColumnMetadata
import com.querydsl.sql.RelationalPathBase

import java.sql.Timestamp
import java.sql.Types

import static com.querydsl.core.types.PathMetadataFactory.forVariable

/**
 * 角色资源关系表(bas_role_resource_rel)
 */
@SuppressWarnings("ALL")
class QBasRoleResourceRel extends RelationalPathBase<BasRoleResourceRel> {
    /** bas_role_resource_rel表 */
    public static final QBasRoleResourceRel basRoleResourceRel = new QBasRoleResourceRel("bas_role_resource_rel")

    /** 角色ID */
    public final NumberPath<Long> roleId = createNumber("roleId", Long.class)
    /** 资源ID */
    public final NumberPath<Long> resourceId = createNumber("resourceId", Long.class)
    /** 创建者 */
    public final StringPath createBy = createString("createBy")
    /** 建立时间 */
    public final DateTimePath<Timestamp> createAt = createDateTime("createAt", Timestamp.class)

    QBasRoleResourceRel(String variable) {
        super(BasRoleResourceRel.class, forVariable(variable), "public", "bas_role_resource_rel")
        addMetadata()
    }

    QBasRoleResourceRel(String variable, String schema, String table) {
        super(BasRoleResourceRel.class, forVariable(variable), schema, table)
        addMetadata()
    }

    QBasRoleResourceRel(String variable, String schema) {
        super(BasRoleResourceRel.class, forVariable(variable), schema, "bas_role_resource_rel")
        addMetadata()
    }

    QBasRoleResourceRel(Path<? extends BasRoleResourceRel> path) {
        super(path.getType(), path.getMetadata(), "public", "bas_role_resource_rel")
        addMetadata()
    }

    QBasRoleResourceRel(PathMetadata metadata) {
        super(BasRoleResourceRel.class, metadata, "public", "bas_role_resource_rel")
        addMetadata()
    }

    void addMetadata() {
        addMetadata(roleId, ColumnMetadata.named("role_id").withIndex(1).ofType(Types.BIGINT).withSize(64))
        addMetadata(resourceId, ColumnMetadata.named("resource_id").withIndex(2).ofType(Types.BIGINT).withSize(64))
        addMetadata(createBy, ColumnMetadata.named("create_by").withIndex(3).ofType(Types.VARCHAR).withSize(64))
        addMetadata(createAt, ColumnMetadata.named("create_at").withIndex(4).ofType(Types.TIMESTAMP).withSize(100))
    }
}
